package main

import (
	"fmt"
	"runtime"
)

func init() {
	// 设置使用2个CPU
	originNumCpu := runtime.GOMAXPROCS(2)
	fmt.Println("原来CPU数：", originNumCpu)
}

func main() {
	fmt.Println("hello world")
	fmt.Println("hello golang")
	fmt.Println("current version:", runtime.Version())
	fmt.Println("CPU数量:", runtime.NumCPU())
	fmt.Println("Go Root:", runtime.GOROOT())
	fmt.Println("Archive:", runtime.GOOS)
	fmt.Println("当前存在的goroutine数量:", runtime.NumGoroutine())
}
